home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / var / lib / dpkg / info / openjdk-6-jre-headless.postinst < prev    next >
Encoding:
Text File  |  2012-06-29  |  2.5 KB  |  96 lines

  1. #!/bin/sh
  2.  
  3. set -e
  4.  
  5. priority=1061
  6. basedir=/usr/lib/jvm/java-6-openjdk
  7. basediralias=/usr/lib/jvm/java-6-openjdk
  8. jdiralias=java-6-openjdk
  9. mandir=/usr/lib/jvm/java-6-openjdk/jre/man
  10. srcext=1.gz
  11. dstext=1.gz
  12. jre_tools='java keytool pack200 rmid rmiregistry unpack200 orbd servertool tnameserv'
  13.  
  14. case "$1" in
  15. configure)
  16.     # fail early.  java currently uses tricks to find its own shared
  17.     # libraries depending on the path of the binary. Will be changed
  18.     # in OpenJDK7
  19.     if ! mountpoint -q /proc; then
  20.     echo >&2 "the java command requires a mounted proc fs (/proc)."
  21.     exit 1
  22.     fi
  23.  
  24.     [ -d /etc/.java ] || mkdir -m 755 /etc/.java
  25.     [ -d /etc/.java/.systemPrefs ] || mkdir -m 755 /etc/.java/.systemPrefs
  26.     if [ ! -f /etc/.java/.systemPrefs/.system.lock ]; then
  27.     touch /etc/.java/.systemPrefs/.system.lock
  28.     chmod 644 /etc/.java/.systemPrefs/.system.lock
  29.     fi
  30.     if [ ! -f /etc/.java/.systemPrefs/.systemRootModFile ]; then
  31.     touch /etc/.java/.systemPrefs/.systemRootModFile
  32.     chmod 644 /etc/.java/.systemPrefs/.systemRootModFile
  33.     fi
  34.  
  35.     for i in $jre_tools; do
  36.     unset slave1 slave2 || true
  37.         if [ -e $mandir/man1/$i.$srcext ]; then
  38.         slave1="--slave \
  39.         /usr/share/man/man1/$i.$dstext \
  40.                 $i.$dstext \
  41.                 $mandir/man1/$i.$srcext"
  42.     fi
  43.     # disabled
  44.         if false && [ -e $mandir/ja/man1/$i.$srcext ]; then
  45.         slave2="--slave \
  46.         /usr/share/man/ja/man1/$i.$dstext \
  47.                 ${i}_ja.$dstext \
  48.                 $mandir/ja/man1/$i.$srcext"
  49.     fi
  50.         update-alternatives \
  51.             --install \
  52.             /usr/bin/$i \
  53.             $i \
  54.             $basediralias/jre/bin/$i \
  55.             $priority \
  56.         $slave1 $slave2
  57.     done
  58.     update-alternatives \
  59.     --install /usr/bin/jexec jexec $basediralias/jre/lib/jexec $priority \
  60.     --slave \
  61.         /usr/share/binfmts/jar \
  62.         jexec-binfmt \
  63.         $basediralias/jre/lib/jar.binfmt
  64.  
  65.     # register binfmt; ignore errors, the alternative may already be
  66.     # registered by another JRE.
  67.     if which update-binfmts >/dev/null && [ -r /usr/share/binfmts/jar ]; then
  68.         update-binfmts --package openjdk-6 --import jar || true
  69.     fi
  70.  
  71.     # activate class data sharing
  72.     case java-6-openjdk in
  73.     *cacao|*shark);;
  74.     *)
  75.     case i386 in i386|sparc)
  76.     rm -f $basedir/jre/lib/i386/client/classes.jsa
  77.     log=$(tempfile)
  78.     if ! $basedir/bin/java -client -Xshare:dump -XX:PermSize=128m > $log; then
  79.         cat >&2 $log
  80.         rm -f $log
  81.         # this may fail on some machines/configurations, just ignore it.
  82.         echo >&2 "ignoring dump failure"
  83.         #exit 1
  84.     fi
  85.     rm -f $log
  86.     esac
  87.     esac
  88.  
  89.     ;;
  90.  
  91. esac
  92.  
  93.  
  94.  
  95. exit 0
  96.